import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { ViewController } from 'ionic-angular';

declare var QRious: any;

/**
 * Generated class for the ServerQrCodePage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */
@IonicPage()
@Component({
  selector: 'page-server-qr-code',
  templateUrl: 'server-qr-code.html',
})
export class ServerQrCodePage {

  qrCode: string;

  constructor(public navCtrl: NavController,
    public navParams: NavParams,
    public viewCtrl: ViewController) {
    let qr = new QRious({ value: this.navParams.get('data') });
    this.qrCode = qr.toDataURL();
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad ServerQrCodePage');
  }

  // dismiss table list modal
  dismiss() {
    this.viewCtrl.dismiss();
  }

}
